<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
    <style type="text/css">
        p{
            background-color: #abc;
        }    
    </style>
<body>
<div id="app">
    <p @click="fn">
        <button @click.self="fn1">动作</button>
    </p>
    <p v-text="msg"></p>
    <a href="http://www.baidu.com" @click.prevent.once="bar">link don't change</a>
</div>
<script src="vue.js"></script>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            msg: '动手吃鸡'
        },
        methods: {
            fn: function () {
                console.log('p元素的单击事件');
            },
            fn1: function () {
                console.log('button的单击事件');
            },
            bar:function () {
                alert(1)
            }

        }
    })
</script>
</body>

</html>